<div class="grid_8 blog-one">
	<?php get_template_part('includes/slider'); ?>
	<?php
	
	if ( have_posts() ) : while ( have_posts() ) : the_post(); 
	if(has_post_format('video')) 
	{
		$format_icon = 'class="video-format-icon"';
		$format_icon_small = ' (Video)';
	}
	else if (has_post_format('audio'))
	{
		$format_icon = 'class="audio-format-icon"';
		$format_icon_small = ' (Audio)';
	}
	else if (has_post_format('gallery'))
	{
		$format_icon = 'class="gallery-format-icon"';
		$format_icon_small = ' (Gallery)';
	}
	else {
		$format_icon = 'class="standard-format-icon"';
		$format_icon_small = '';
	}
			
	$review_show =  get_post_meta(get_the_ID(), 'reedwan_show_review', true);
	$overall_percentage =  get_post_meta(get_the_ID(), 'reedwan_overall_score', true);

	$gallImages = get_post_meta($post->ID, 'gallImg', true);
	$video = get_post_meta($post->ID, 'videoEmbed', true);	
	 ?>
	 <div class="blog-post-four" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<div class="half-meta">
			<div class="half-meta-time">
				<span class="day"><?php echo get_the_date('d');  ?></span>
				<span class="year"><?php echo get_the_date('Y');  ?></span>
				<span class="month"><?php echo get_the_date('F');  ?></span>
			</div>
			<div class="half-meta-author">
				<?php _e('By ', 'unicorn'); ?><?php the_author(); ?>
			</div>
			<div class="half-meta-comment">
				<?php comments_number(__( '0 Comments', 'unicorn'), __('1 Comments', 'unicorn'), __('% Comments', 'unicorn'));?>
			</div>
			<div class="half-meta-review">
				<?php if ($review_show == 'Yes' && $overall_percentage!=0) { ?>
						<span class="blog-content-score"><?php _e('Review : ', 'unicorn'); ?> <?php echo $overall_percentage; ?>%</span>
					<?php } ?>
					
			</div>
			<div class="half-meta-share">
			</div>
		</div>
		<div class="half-content-block">
			<?php if(has_post_format('video')):  ?>
				<?php $embedVideo = htmlspecialchars_decode($video); ?>
				<?php if($embedVideo!=''):  ?>
				<!-- Video -->
				<div class="featured-video embed-container">
					<?php echo stripslashes( $embedVideo ); ?>
				</div>
				<?php endif; ?>
				<div class="big-desc">
						<h3><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h3>
						<div class="clear"></div>
						<p><?php echo string_limit_words(get_the_excerpt(), 55); ?></p>
						<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More ', 'unicorn'); ?>&rarr;</a>
				</div>
			<?php elseif(has_post_format('gallery') ):  ?>
				<!-- Gallery -->
				<div id="gallery" class="royalSlider rsDefault fwImage">
				<?php if (count($gallImages) > 0): ?>
				<?php foreach((array)$gallImages as $gallImg ):?>
					<a class="rsImg" data-rsBigImg="<?php echo $gallImg;?>" href="<?php echo $gallImg;?>"><img class="rsTmb" src="<?php echo $gallImg; ?>"/></a>
				<?php
				endforeach; 
				endif; ?>
				</div>
				<div class="big-desc">
						<h3><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h3>
						<div class="clear"></div>
						<p><?php echo string_limit_words(get_the_excerpt(), 55); ?></p>
						<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More ', 'unicorn'); ?>&rarr;</a>
				</div>
			<?php else: ?>
				<?php if(has_post_thumbnail()): ?>
					<div class="half-content">
						<a <?php echo $format_icon; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_post_thumbnail('small-slider', array('class' => 'overlay'));?></a>	
					</div>
					<div class="big-desc">
						<h3><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h3>
						<div class="clear"></div>
						<p><?php echo string_limit_words(get_the_excerpt(), 55); ?></p>
						<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More ', 'unicorn'); ?>&rarr;</a>
					</div>
				<?php else: ?>	
					<div class="big-desc">
						<h3><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h3>
						<div class="clear"></div>
						<p><?php echo string_limit_words(get_the_excerpt(),55); ?></p>
						<a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More ', 'unicorn'); ?>&rarr;</a>
					</div>
				<?php endif; ?>	
			<?php endif; ?>	
		</div>	
	</div>
	<?php endwhile; else: ?>
		
		<h1><?php _e('Sorry, no entries found.', 'unicorn');?></h1>
	
	<?php endif; wp_reset_query();?>
<?php kriesi_pagination(); ?>
</div>
